<!--
 * @Description: 表格
 * @Author: rendc
 * @Date: 2025-09-10 09:09:45
 * @LastEditors: rendc
 * @LastEditTime: 2025-09-10 10:24:29
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>表格</title>
</head>

<body>
  <h3>学生信息表</h3>
  <table>
    <!-- 表头 -->
    <tr>
      <th>姓名</th>
      <th>性别</th>
      <th>年龄</th>
    </tr>
    <tr>
      <td>张三</td>
      <td>男</td>
      <td>18</td>
    </tr>
    <tr>
      <td>李四</td>
      <td>女</td>
      <td>20</td>
    </tr>
  </table>
  <h3>表格的完整结构</h3>
  <table border="1px" cellspacing="0">
    <!-- 表格的标题 -->
    <caption>学生信息表</caption>
    <!-- 表头 -->
    <thead align="center">
      <tr align="right">
        <th width="100" align="center">姓名</th>
        <th>性别</th>
        <th align="center">年龄</th>
      </tr>
    </thead>
    <!-- 表体 -->
    <tbody align="center">
      <!-- 数据 -->
      <tr>
        <td style="color: red;" height="50" valign="bottom">张三</td>
        <!-- 垂直方向 行合并 -->
        <td rowspan="2">男</td>
        <td>180000</td>
      </tr>
      <tr>
        <td>李四</td>
        <!-- <td>男</td> -->
        <td>20</td>
      </tr>
    </tbody>
    <!-- 表脚 -->
    <tfoot align="center">
      <tr>
        <td colspan="2">共计</td>
        <!-- <td></td> -->
        <td>2人</td>
      </tr>
    </tfoot>
  </table>
</body>

</html>